@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

@import "icomoon/style.css";

:root {
	--background: #000000;
	--text: #fafafa;
	--controls: rgba(39, 39, 39, 0.9);
	--controls-active: #333333;

	--red: #c0392b;
	--green: #21c73d;
}

* {
	outline: none;
}
html {
	font-size: 1.2rem;
}
body {
	margin: 0px;
	font-family: "Inter", system-ui, sans-serif;
	font-optical-sizing: auto;
	line-height: 1.6;
	background-color: var(--background);
	color: var(--text);
}
a {
	color: inherit;
}
button {
	font: inherit;
	color: inherit;
	cursor: pointer;
}
button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
input[type="text"],
textarea {
	background: none;
	font: inherit;
	display: block;
	width: 100%;
	border: none;
	color: inherit;
	padding: 0.25rem 1rem;
	box-sizing: border-box;
}
textarea {
	resize: vertical;
	min-height: 2rem;
}
footer {
	margin: 1rem;
}
footer section {
	margin: 1rem auto;
	text-align: center;
}
footer .flex {
	display: flex;
	justify-content: space-between;
}
footer a {
	margin: 0px 0.5rem;
}
[v-cloak] {
	display: none;
}
.wrap {
	width: 100%;
	max-width: 640px;
	margin: auto;
}
.wrap.max {
	max-width: none;
}
.title {
	display: inline-block;
	font-size: 1.6rem;
	line-height: 1.5;
	font-style: italic;
}
.small {
	font-size: 0.75rem;
}
.light {
	opacity: 0.75;
}
.row {
	margin: 1rem;
}
.flex {
	display: flex;
	justify-content: center;
}

#toast {
	background-color: var(--text);
	color: var(--background);
	text-align: center;
	box-sizing: border-box;
	position: fixed;
	z-index: 10;
	left: 0px;
	right: 0px;
	top: 0rem;
	max-height: 0;
	margin: auto;
	overflow: hidden;
	font-size: 1rem;
	line-height: 2rem;
	transition: max-height 0.25s ease-in;
}
#toast.show {
	max-height: 5rem;
}
#toast.error {
	background: var(--red);
}
#toast.success {
	background: var(--green);
}
#channelbox {
	position: relative;
	margin-bottom: 0.5rem;
}
#channelbox .perma-placeholder {
	position: absolute;
	left: 0px;
	top: 0px;
	bottom: 0px;
	padding: calc(0.5rem + 2px) 1rem;
	opacity: 0.5;
}
#channelbox input {
	padding: 0.5rem 1rem;
	padding-left: 5.3rem;
	border: 2px solid var(--text);
	border-radius: 0.5rem;
}
#channelbox button {
	background-color: var(--text);
	color: var(--background);
	padding: 0.5rem 2rem;
	border: 2px solid var(--text);
	margin-left: 1rem;
	border-radius: 0.5rem;
}

#blanket {
	position: fixed;
	top: 0px;
	right: 0px;
	bottom: 0px;
	left: 0px;
	z-index: 10;
}
#controls {
	width: 100%;
	max-width: 280px;
	position: fixed;
	bottom: 0.5rem;
	left: 1rem;
	right: 1rem;
	margin: auto;
	z-index: 50;
}
#controls #buttons {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--controls);
	padding: 0.25rem;
	box-sizing: border-box;
	border-radius: 2rem;
	margin-top: 0.5rem;
}
#controls button {
	min-width: 2rem;
	height: 2rem;
	border-radius: 1rem;
	border: none;
	background: var(--controls-active);
}
#controls button:hover {
	opacity: 0.7;
}
#controls button.red {
	background: var(--red);
}
#controls button.join {
	background: var(--green);
	padding-left: 0.5rem;
	padding-right: 0.5rem;
}

#controls #extra,
#controls #chats .chat,
#controls #name {
	width: 100%;
	max-width: 280px;
	margin: auto;
	background: var(--controls);
	border-radius: 1rem;
	padding: 0.25rem 0px;
}
#controls #extra ul {
	margin: 0px;
	padding: 0px;
	list-style: none;
}
#controls #extra ul li {
	padding: 0.25rem 0.5rem;
	border-radius: 0.75rem;
}
#controls #extra ul li.indent {
	padding-left: 1.5rem;
}
#controls #extra ul li.action {
	cursor: pointer;
}
#controls #extra ul li.action.red {
	color: var(--red);
}
#controls #extra ul li.action:hover {
	background: var(--controls-active);
}
#controls #extra ul li i {
	margin-right: 0.5rem;
}
#controls #extra ul li a {
	color: inherit;
	text-decoration: none;
}
#controls #chats #scroll {
	max-height: 50vh;
	overflow-y: auto;
}
#controls #chats .chat textarea {
	padding: 0px;
	resize: none;
	height: 3rem;
}
#controls #chats .chat {
	padding: 1rem;
	line-height: 1.3;
	border-bottom: 1px solid var(--controls-active);
	box-sizing: border-box;
	margin-top: 0.5rem;
}
#controls #chats .chat:last-child {
	border-bottom: none;
}
#controls #chats .chat .name {
	font-weight: bold;
}
#controls #chats .chat .date {
	font-size: 0.8rem;
}

#videos {
	display: grid;
	width: 100%;
	height: calc(100vh - 2.5rem);
	padding: 0.5rem;
	box-sizing: border-box;
	gap: 0.5rem;
	align-items: center;
	justify-items: center;
}

/* Layout for different participant counts using CSS Grid */
#videos.layout-1 {
	grid-template-columns: 1fr;
	grid-template-rows: 1fr;
}

#videos.layout-2 {
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr;
}

#videos.layout-3,
#videos.layout-4 {
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr 1fr;
}

#videos.layout-5,
#videos.layout-6 {
	grid-template-columns: 1fr 1fr 1fr;
	grid-template-rows: 1fr 1fr;
}

#videos.layout-7-plus {
	grid-template-columns: repeat(4, 1fr);
	grid-auto-rows: auto;
}

#videos .video video {
	object-fit: contain;
	width: 100%;
	height: 100%;
}
#videos .video.self video {
	transform: rotateY(180deg);
	-webkit-transform: rotateY(180deg);
	-moz-transform: rotateY(180deg);
}
#videos .video {
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
	padding: 0.25rem;
	border-radius: 0.5rem;
	width: 100%;
	height: 100%;
}
#videos .video .meta {
	position: absolute;
	bottom: 0.5rem;
	left: 0.5rem;
	background: var(--background-trans);
	color: var(--white);
	font-size: small;
	padding: 0.1rem 0.25rem;
	border-radius: 0.2rem;
	z-index: 5;
}
#videos .video .meta i.green {
	color: var(--green);
}
.fullscreen-btn {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	background: var(--controls);
	color: #fff;
	border: none;
	border-radius: 0.5rem;
	padding: 0.25rem 0.5rem;
	z-index: 10;
	cursor: pointer;
	font-size: 1.2rem;
	display: flex;
	align-items: center;
	justify-content: center;
}
.fullscreen-btn:hover {
	background: var(--controls-active);
}

@media only screen and (max-width: 600px) {
	html {
		font-size: 1rem;
	}
	#videos.layout-2 {
		grid-template-columns: 1fr;
		grid-template-rows: 1fr 1fr;
	}
	#videos.layout-3 {
		grid-template-columns: 1fr;
		grid-template-rows: 1fr 1fr 1fr;
	}
	#videos.layout-4 {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: 1fr 1fr;
	}
	#videos.layout-5,
	#videos.layout-6 {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: 1fr 1fr 1fr;
	}
	#videos.layout-7-plus {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: auto;
	}
	footer .flex {
		flex-direction: column;
		gap: 2rem;
	}
}
